{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">入库单管理</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
            <script type="text/html" id="barTool">
                <a data-open='{:url("edit")}?id={{ d.id }}' class="layui-btn layui-btn-xs" title="编辑">编辑</a>
                <a href='{:url("delete")}?id={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
            </script>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
layui.use('yznTable', function() {
    var table = layui.yznTable;

    var init = {
        table_elem: '#currentTable',
        add_url: "{:url('add')}",
    };

    table.render({
        init: init,
        id:'currentTable',
        elem: '#currentTable',
        toolbar: ['refresh','add'],
        url: '{:url("index")}',
        search:true,
        cols: [
            [
                { field: 'id',width: 100, title: '序号'},
                { field: 'number', width: 250, align: 'left', title: '入库单号'},
                { field: 'type_msg', title: '入库类型' },
                { field: 'create_time', title: '入库时间' },
                { field: 'bz', title: '备注' },
                { field: 'admin', title: '创建人' },
                { field: 'mdtime', title: '最后更新时间' },
                { fixed: 'right', width: 160, title: '操作', toolbar: '#barTool' }
            ]
        ],
        page:{},
    });
});
</script>
{/block}